Susan VanderPlas
2017-12-04
As of Monday, 12 people have completed Course 1 and one person has completed Course 2.
Average progress on Course 2 is 50.6%.
As of Monday, 12 people have completed Course 1 and one person has completed Course 2.
Average progress on Course 2 is 50.6%.
(Vulcan mind meld isn't an option, unfortunately)
A set of conventions for programming that make code easily readable and sharable
NPPD will use a modified form of Google's style guide
variableName … should be descriptivefunction_name or FunctionName<-. Do not use = or ->.= is used inside function calls - this is ok) and {my_fun <- function(x) {
return(x)
}
x <- 3
if (x > 2) {
y <- 4
} else {
y <- 2
}
File Layout:
# Author: Susan Vanderplas
# ------------------------------------------------------
# This file demonstrates the ideal layout of an R code
# file. This block is for a description of the code's
# purpose and file contents.
# ------------------------------------------------------
# --- Packages -----------------------------------------
library(ggplot2)
library(dplyr)
# ------------------------------------------------------
myfun <- function(x) {
# This function returns the value that is passed in
# Basically, it does nothing.
# Args:
# x: The value to be returned
# Returns:
# x: The value passed in to the function
return(x)
}
# This code executes myfun on the value 3
myfun(3)
stop() or stopifnot() should be used to generate errorswarning("Message goes here") should be used to generate warningsmessage("Message goes here") should be used to generate messages.